package EstimatorPackage;

import DataSetPackage.SimpleView;
import DataSetPackage.View;
import HierarchyPackage.AffixHierarchies.AffixHClass;
import HierarchyPackage.HClass;
import HierarchyPackage.Hierarchy;

/**
 *
 * @author Martin Haulrich
 */
public class SimSuffixEstimatorExp extends AbstractEstimatorExp implements EstimatorExp {

    final EmpSuffix est;


    public SimSuffixEstimatorExp(EmpSuffix est) {
        super();
        this.est = est;
    }

    @Override
    public double getEstimate(HClass h, Hierarchy hier) {

        AffixHClass sh = (AffixHClass) h;
        return est.getEstimate(sh.affix);
    }

    @Override
    public double getEstimate(Integer did, View v) {
        //    double estimate = est.getEstimate(START + ((SimpleView) v).getFeatures(did)[0] + STOP);
        double estimate = est.getEstimate(((SimpleView) v).getFeature(did));
        //  System.err.println("SufEstExp: " + did + " : " + START + ((SimpleView) v).getFeatures(did)[0] + STOP +  "  = " + estimate);
        return estimate;
    }
}

